<?php $sf_response->setTitle( __("Annonce gratuite ") . sfOutputEscaper::unescape($ads->title)) ?>
<div id="arianne" class="span-24 last">
        <?php echo link_to('Accueil','@homepage')?>
        > <?php echo  link_to( sfOutputEscaper::unescape($ads->SubCategory->title) , '@searchBySubCat?subcat_id=' . $ads->SubCategory->id  . '&title=' . Doctrine_Inflector::urlize('annonces '.$ads->SubCategory->title)) ?>
        > <?php echo sfOutputEscaper::unescape($ads->title)  ?>
</div>

<div id="ads_detail" class="span-24 last fontstyle1">
    <div id="leftCol" class="span-17">
        <h1>
            <p><?php echo sfOutputEscaper::unescape($ads->title)   ?></p>
            <p class='price'>
                <?php echo str_replace(',00', '', format_currency($ads->price, sfConfig::get('app_currency'), 'fr_FR') ); ?>
            </p>
        </h1>
        <p><?php echo __("Mise en ligne le ") . format_date($ads->created_at,'EEEE dd. MMMM yyyy', $sf_user->getCulture()) . '<b>' . __(' par ') .'</b>'. $ads->Seller->getFullname();   ?> </p>

        <div class="span-8" style="float:left; margin-top: 20px;">
            <?php  $big_img =  '/uploads/image_path1/' . $ads->image_path1;   ?>
            <ul>
                <li id="adsPhoto">
                    <?php if( $ads->image_path1 != ''): ?>
                    <a href='<?php echo $big_img ?>'  class="img_ads_big"  width=600 height=550 >  
                        <?php  echo image_tag('/uploads/image_path1/' . $ads->image_path1, array("class"=>"img_ads", "id"=>"image1" ,"width"=>"310", "height"=>"250",'alt' => sfOutputEscaper::unescape($ads->title)));   ?>
                    </a>
                    <?php else: ?>
                        <?php echo image_tag('no_image.jpg', array("class"=>"img_ads shadow", "id"=>"image1" ,"width"=>"310", "height"=>"250")) ?>
                    <?php endif;  ?>
                </li>
                <li>
                    <?php  
                       if( $ads->image_path1 != '' ): 
                        $image_2 = $ads->image_path2 != '' ? $ads->image_path2 : $ads->image_path1;
                        $indice = $ads->image_path2 != '' ? 2 : 1;
                        echo image_tag("/uploads/image_path$indice/$image_2", array("class"=>"thumb", "id"=>"image2", 'alt' => sfOutputEscaper::unescape($ads->title)));   
                       endif; 
                     ?>
                </li>
            </ul>
        </div>

        <div id="description" class="span-7 last" style="float:right; margin-top: 20px;">
            <p><strong>Description :</strong></p>
            <?php echo sfOutputEscaper::unescape($ads->description) ?>
        </div>
        
        
	<br/>
    </div>
    
    
    <div id="rightCol" class="span-6 last">
        <table>
            <tr><th>Contacter l'annonceur</th></tr>
            <tr>
                <td>
                     <?php echo link_to( __("Envoyer un email"), "@sendMailToSellerAjax", array('class'=>'fancybox iframe letter_icon', 'width' => 600, 'height' => 400) )  ?>
                </td>
            </tr>
            <tr>
                <td>
		   <p class="phone_icon">
                    <?php echo $ads->Seller->mobile ?><br/>
                    <?php echo $ads->Seller->phone ?>
		   </p>
                </td>
            </tr>
        </table>
        <br/><br/>
        <?php $islogin = $sf_user->isauthenticated() ? '' :' fancybox'; ?>
        <table>
            <tr><th>Gérer votre annonce</th></tr>
            <tr><td><?php echo link_to( __("Envoyer à un ami"), "@sendToFriend", array("title" => __('Envoyer à un ami'), 'class' => 'friend_icon fancybox iframe', 'width' => 600, 'height' => 400) ) ?></td></tr>
            
            <?php if($ads->seller_id == $sf_user->getAttribute('sellerId')): ?>
            <tr><td><?php echo link_to( __("Modifier cette annonce"), "@updateAds?ads_id=".$ads->id . "&slug=".__("modifier-annonce"), array("title" => __('Modifier cette annonce'), 'class' => "edit_icon $islogin") ) ?></td></tr>
            <tr><td><?php echo link_to( __("Supprimer cette annonce"), "@deleteAds?id=".$ads->id, array("title" => __('Supprimer'), 'class' => 'delete_icon', 'confirm'=> __('Etes-vous sûr de vouloir supprimer cette annonce ?') ) ) ?></td></tr>
            <?php endif; ?>
            
            <tr><td><a onclick='javascript:window.print()' class='print_icon'><?php echo __('Imprimer cette annonce') ?></a></td></tr>
            <tr><td><?php echo link_to( __("Signaler un abus"), "@abus", array("title" => __('Signaler un abus'), 'class' => 'block_icon fancybox iframe', 'width' => 600, 'height' => 400) ) ?></td></tr>
            <tr><td></td></tr>
            <tr><td></td></tr>
            <tr>
                <td style="text-align: center; vertical-align: top; padding: 0px; padding-top: 20px;"  >
                    <ul class="shareBtn">
                        <li><?php include_partial('static/fb_like_btn') ?></li>
                        <li><?php include_partial('static/fb_share_btn') ?></li>
                        <li><?php include_partial('static/twitter_btn') ?></li>
                        <li><?php include_partial('static/google_plus_btn') ?></li>
                    </ul>
                </td>
            </tr>
        </table>
    </div>
</div>
<br/>
<br/>
<div class="span-24 last"><center><?php include_partial('static/adsense_horz_728_90')?></center></div>

<?php echo javascript_tag() ?>
$(document).ready(function(){  
    
    $('#image2').click( function(){
        var src_tmp = $('#image1').attr('src'); 
        $('#image1').attr('src', $(this).attr('src') );
        $('#image2').attr('src', src_tmp );
        $('.img_ads_big').attr('src', $(this).attr('src') );
    });
    
    <?php if ( $ads->image_path2 != '' ): ?>
    var src_tmp1 = $('#image1').attr('src');
    var src_tmp2 = $('#image2').attr('src');
    $("#image2")
    .mouseover(function() {
    	$('#image1').attr('src', $(this).attr('src') );
    	$('#image2').attr('src', src_tmp1 );
  	})
  	.mouseout(function(){
    	$('#image1').attr('src', src_tmp1  );
    	$('#image2').attr('src', src_tmp2 );
  	});
    <?php endif; ?>
    
    
    $("a.fancybox.iframe").fancybox({
	        'padding':10,
	        'margin':20,
	        'opacity':false,
	        'modal':false,
	        'cyclic':false,
	        'scrolling':false,
	        'width':500,
	        'height':400,
	        'autoScale':false,
	        'autoDimensions':true,
	        'titlePosition'		: 'inside',
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
	        'type':'iframe'
        }
    );
    
       
    var options = {  
            zoomType: 'standard',  
            lens:true,  
            preloadImages: false,  
            alwaysOn:false,  
            zoomWidth: 360,  
            zoomHeight: 320,  
            xOffset:20,  
            yOffset:0,  
            position:'right'
    };
    <?php if ( $ads->image_path1 != '' ): ?>
    $('.img_ads_big').jqzoom(options);  
    <?php endif; ?>
});
<?php echo end_javascript_tag() ?>